home *** CD-ROM | disk | FTP | other *** search
/ Video Toaster 4.0 / Video Toaster v4.0.iso / arexx / editor / stopframe.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-06  |  3KB  |  107 lines

  1. /* StopFrame.rexx  Grabs frames on cue from GPI trigger for stop-action animation */
  2. /* By Arnie Cachelin © 1992 NewTek Inc. */
  3.  
  4. /*
  5.     This program will grab and save frames on cue from the GPI trigger.
  6.     If you enter a number to grab, it will save that many then exit.
  7.     Otherwise, 3 frames will be saved, then the prog. will exit.  Since
  8.     the Toaster is waiting for GPI input most of the time, it will not
  9.     respond  to anything else, which you may find annoying.  You can easily
  10.     give  your Toaster GPI pulses by attaching a spare mouse or joystick to
  11.     the second mouse port then clicking the button.  You can also find long
  12.     joystick extender cables at places like Radio Shack.
  13.  
  14.     To grab frames for a claymation of stop-motion style animation, setup your
  15.     camera and 'actors', hook up a GPI trigger, and start this script with
  16.     appropriate arguments.  When your first frame is ready, hit the trigger
  17.     to grab and save it.  The toaster will then go into an 'onionskin' mode
  18.     where the camera is half dissolved over the last frame for ease of
  19.     positioning the actors.  When you hit the GPI again, the Toaster will leave
  20.     onionskin mode and grab the next frame, then return to onionskin mode.
  21.  
  22.     For best results, watch out for stray shadows, or shadows from the sun which
  23.     will change over the course of your shoot.
  24. */
  25.  
  26. OPTIONS RESULTS
  27. parse arg count name startframe
  28.  if count="" then count=3
  29.         if startframe="" then startframe=0
  30. TOASTERLIB="ToasterARexx.port"
  31. call remlib('ToasterARexx.port')
  32. call remlib('PROJECT_REXX_PORT')
  33.  
  34. call addlib('PROJECT_REXX_PORT' , 0)
  35.  
  36. call set_view(2)
  37. if req_tell("StopFrame 2.0") = 0 then call quit
  38.  
  39. rx startfilereq("Save Frames Where?","Toaster:Images","StopMotion.Rgb.")
  40.  
  41. exit=1
  42. do while exit=1
  43.   name=queryfilereq()
  44.   if name=0 then call quit
  45.   if name~="" then exit=0
  46.   address command "c:wait 1"
  47.   say name
  48. end
  49.  
  50. count=0
  51. do while(count<1)
  52.    count=req_number("Number Of Frames To Grab",100)
  53.    if count=0 then call quit
  54.    end
  55.  
  56. startframe=0
  57. do while(startframe<1)
  58.    startframe=req_number("Starting Frame #",1)
  59.    if startframe=0 then call quit
  60.    end
  61.  
  62. input=req_number("Input To Grab From 1-4",1)
  63. if input=0 then call quit
  64. if input>4 then input=4
  65. inputp="P00"||input
  66. inputm="M00"||input
  67.  
  68. if req_tell("Still want to continue?")=0 then call quit
  69.  
  70. IF ~SHOW('Libraries',TOASTERLIB) THEN
  71.   IF ~ADDLIB(TOASTERLIB , 0) THEN say "Please start your Toaster"
  72.  
  73. say "Saving "count" frames as "name
  74. Switcher(TOSW)        /* Go to Switcher screen */
  75. /*if ~Switcher(CKGD,A48) then Switcher(GRID,A11)   /* Select Fade in getsmall */*/
  76. /*else Switcher(GRID,A48)*/
  77. Switcher(inputp)
  78. Switcher(LVID)
  79. Switcher(PDV1)
  80. Switcher(inputp)
  81. Switcher(SGPI,POS)    /* Set GPI trigger to positive (leading edge of pulse) */
  82. Switcher(WAIT,GPI)    /* Wait for GPI trigger to come in for first frame */
  83. Do i=startframe to startframe+count-1
  84.   Switcher(FVID)        /* Freeze frame */
  85.   Frame=right(trim(i),3,"0")
  86.   fname =strip(name)||right(i,3,'0')
  87.   call Switcher(SRGB,fname,0,5)
  88.   Switcher(inputp)
  89.   Switcher(MDV1)
  90.   Switcher(TBAR,255)
  91.   call req_open("Current Frame ("||right(i,3,'0')||")")
  92.   Switcher(WAIT,GPI)    /* Wait for GPI trigger to come in */
  93.   Switcher(AUTO)
  94.   Switcher(LVID)        /* Set to live digital video */
  95.         Switcher(PDV1)
  96.   Switcher(inputp)
  97.         Switcher(FRES)
  98.   Switcher(WAIT,60)
  99.   call req_close()
  100. end
  101. call req_tell("All Done!")
  102. call remlib('PROJECT_REXX_PORT')
  103. call remlib('ToasterARexx.port')
  104.  
  105. exit
  106.  
  107.